﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="FL.Web.BackEnd.UploadFile" %>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>文件上传</title>
    <script src="/SFramework/miniui/swfupload/swfupload.js"></script>
</head>
<script src="/SFramework/boot.js"></script>
<body>
  <input id="fileupload1" class="mini-fileupload" name="Fdata" limitType="*.txt" 
    flashUrl="/SFramework/miniui/swfupload/swfupload.swf"
    uploadUrl="single.aspx"
    onuploadsuccess="onUploadSuccess" 
    onuploaderror="onUploadError" onfileselect="onFileSelect"
    />
     <br />
     <input type="button" value="上传" onclick="startUpload()"/>
</body>
</html>
<script type="text/javascript">
    mini.parse();

    //动态设置url
    var fileupload = mini.get("fileupload1");
    fileupload.setUploadUrl("single.aspx");

    function onFileSelect(e) {
        alert("选择文件");
    }
    function onUploadSuccess(e) {

        alert("上传成功：" + e.serverData);

        this.setText("");
    }
    function onUploadError(e) {

    }

    function startUpload() {
        var fileupload = mini.get("fileupload1");

        fileupload.startUpload();
    }


</script>